<!DOCTYPE html>
<html>
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <link rel="stylesheet" href="../../Bootstrap/css/bootstrap.min.css" />
    <link rel="stylesheet" href="../../css/index.css" />
    <script src="../../Bootstrap/js/bootstrap.bundle.min.js"></script>
    <title>HTML5——坦克大战</title>
    <link rel="shortcut icon" href="../../favicon.ico" type="image/x-icon" />
    <script>
      if (
        /Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(
          navigator.userAgent
        )
      ) {
        // 如果检测到是移动设备，重定向到另一个页面或者显示一个警告
        window.location.href = "404.html";
      }
      document.addEventListener("DOMContentLoaded", function () {
        document.addEventListener(
          "keydown",
          function (event) {
            // 检查是否是方向键
            if (
              event.key === "ArrowUp" ||
              event.key === "ArrowDown" ||
              event.key === "ArrowLeft" ||
              event.key === "ArrowRight"
            ) {
              // 阻止默认行为（滚动）
              event.preventDefault();
            }
          },
          false
        );
      });
    </script>
    <style>
      body{
        background-color: darkslategrey;
      }
      .back-link {
        display: inline-block;
        padding: 10px 20px;
        background-color: #4caf50;
        color: white;
        text-decoration: none;
        border-radius: 4px;
        transition: background-color 0.3s ease;
      }

      .back-link:hover {
        background-color: #45a049;
      }
    </style>
    <style>
    .nav-item a {
      text-align: left !important;
    }

    @media (min-width: 992px) {
      .nav-sm-fix {
        margin-bottom: 75px;
      }
    }
  </style>
  </head>

  <body>
      <!-- 导航 -->
  <nav class="navbar navbar-expand-lg bg-body-tertiary fixed-top">
    <div class="container">
      <a class="navbar-brand" href="#"><img src="../../assets/images/logo.png" alt="" /></a>
      <button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbarNav"
        aria-controls="navbarNav" aria-expanded="false" aria-label="Toggle navigation">
        <span class="navbar-toggler-icon"></span>
      </button>
      <div class="collapse navbar-collapse" id="navbarNav">
        <ul class="navbar-nav">
          <li class="nav-item">
            <a class="nav-link" aria-current="page" href="../../index.html" target="_blank">首页</a>
          </li>
          <li class="nav-item">
            <a class="nav-link" href="https://gitee.com/LynLuc/a-simple-game-release-page" target="_blank">Gitee</a>
          </li>
          <li class="nav-item ">
            <a class="nav-link" href="../2048/game2048.html" target="_blank">2048</a>
          </li>
          <li class="nav-item ">
            <a class="nav-link" href="../wuzi/wuzi.html" target="_blank">五子棋</a>
          </li>
          <li class="nav-item ">
            <a class="nav-link" href="../snake_game/index.html" target="_blank">贪吃蛇</a>
          </li>
          <li class="nav-item active">
            <a class="nav-link" href="#">坦克大战</a>
          </li>
          <li class="nav-item dropdown">
            <a class="nav-link dropdown-toggle" href="#" role="button" data-bs-toggle="dropdown" aria-expanded="false">
              关于
            </a>
            <ul class="dropdown-menu">
              <li><a class="dropdown-item" href="https://gitee.com/LynLuc/a-simple-game-release-page"
                  target="_blank">项目地址</a>
                <a class="dropdown-item" href="https://gitee.com/LynLuc/a-simple-game-release-page"
                  target="_blank">gitee.com/LynLuc/...</a>
              </li>
              <li>
                <hr class="dropdown-divider">
              </li>
              <li><a class="dropdown-item" href="#">班级</a></li>
              <a class="dropdown-item" href="#">23软件技术2班</a>
          </li>
          <li>
            <hr class="dropdown-divider">
          </li>
          <li><a class="dropdown-item" href="#">学号</a></li>
          <a class="dropdown-item" href="#">23003007</a>
          </li>
        </ul>
        </li>
        </ul>
      </div>
    </div>
  </nav>
  <!-- 修复导航栏手机端ui高度 -->
  <div class="nav-sm-fix"></div>
    <div
      id="main"
      style="text-align: center; margin-left: auto; margin-right: auto"
    ></div>
  </body>

  <script type="text/javascript" src="js/tank.js"></script>
  <script>
    window.onload = function () {
      document.getElementById("main").appendChild(canvas);
      init();
    };
  </script>
</html>
